﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Common;

namespace BusinessLogic
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IWCFProducts" in both code and config file together.
    [ServiceContract]
    public interface IWCFProducts
    {
        [OperationContract]
        Product GetProduct(int productID);

        [OperationContract]
        IEnumerable<Product> GetProducts();

        [OperationContract]
        IEnumerable<Comment> GetCommentsForProduct(int productID);

        [OperationContract]
        decimal GetRatingForProduct(int productID);

        [OperationContract]
        int GetNoOfProductRates(int productID);

        [OperationContract]
        int GetNoOfProductComments(int productID);

        [OperationContract]
        decimal CalculateProductAvgRating(int productID);

        [OperationContract]
        IEnumerable<Category> GetCategories();

        [OperationContract]
        IEnumerable<Product> GetProductsByName(string name);

        [OperationContract]
        IEnumerable<Product> GetProductByCategory(int CategoryID);

        [OperationContract]
        IEnumerable<Product> GetProductsByDateListed();

        [OperationContract]
        IEnumerable<Product> GetProductsByPriceAsc();

        [OperationContract]
        IEnumerable<Product> GetProductsByPriceDesc();

        [OperationContract]
        IEnumerable<Product> GetProductNameInUserFaults(string username);

        [OperationContract]
        void UpdateProduct(Product productToUpdate);

        [OperationContract]
        IEnumerable<Fault> GetFaultStatus();
    }
}
